import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
import { tinySmbTheme, tinyInfinityTheme, tinyAuroraTheme, tinyImpressionTheme, tinyDeepTheme, tinyGalaxyTheme } from '@opentiny/vue-theme/theme'
import { App } from "vue";

const theme = new TinyThemeTool(tinySmbTheme, 'tinyStyleSheetId') // 初始化主题

const themes: Record<string, any> = {
    smb: tinySmbTheme,
    aurora: tinyAuroraTheme,
    infinity: tinyInfinityTheme,
    impression: tinyImpressionTheme,
    deep: tinyDeepTheme,
    galaxy: tinyGalaxyTheme,
}

export function toggleTheme(name:string){
    theme.changeTheme(themes[name])
}

export function useTheme(app: App){
    app.config.globalProperties.theme = theme // 将 theme 对象挂到 vue 实例中
}

